/*
 * NodeGroup.cpp
 *
 *  Created on: Oct 9, 2011
 *      Author: USHonDan
 */

#include <assert.h>
#include "NodeGroup.h"
#include "LeafNode.h"
#include "IndexNode.h"

NodeGroup::NodeGroup(int numNodes) {
	assert(sizeof(LeafNode) == sizeof(IndexNode));
	_nodes = (Node*) new char[numNodes*sizeof(LeafNode)];
}

NodeGroup::~NodeGroup() {
	delete [] _nodes;
}

Node *NodeGroup::FetchNode(int idx) {
	return (Node *) &(((LeafNode*)_nodes)[idx]);
}
